<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#div1{
				width: 900px;
				height: 800px;
				margin-top: 20px;
				margin-left: 60px;   
    			border: 1px solid #ddd;
			}
			#head{
				border-bottom: 2px solid #ff5f5f;
			    cursor: pointer;
			    color: #ffffff;
			    background: #ff5f5f;
				font-size: 14px;
			    height: 44px;
			    line-height: 45px;
			    width: 111px;
			    text-align: center;
			}
			#div1_1{
				padding: 20px 0;
			}
			.div1_1_1{
				width: 846px;
				height: 45px;
			    line-height: 45px;
			    padding: 0 20px;
			}
			.div1_1_1:hover {
			    background: #e6e6e6;
			}
			a{
				display: block;
			    font-size: 14px;
			    color: #333;
			    float: left;
			    text-decoration: none;
			    cursor: pointer;
			}
			 a:hover {
			    color: #ff6565;
			}
			.a{
				margin-top: 30px;
				margin-left: 20px;
			    width: 20px;
			    border-radius: 4px;
			    font-size: 14px;
			    padding: 8px 20px;
			    color: #fff;
			    background-color: #ff6464;
			    border-color: #ff6464;
			    text-decoration: none;
			    transition: all .2s;
			    line-height: 1.3333333;
			    border: 1px solid transparent;
			}
			.a:hover {
			    color: black;
			}
			span{
				float: right;
    			color: #999;
			}
		</style>
	</head>
	<body>
		<div id="div1">
			<div id="head">
				公告栏
			</div>
			<div id="div1_1">
				<div class="div1_1_1">
					<a href="">一点车点讯号平台关于封禁违规账号的通知（4月13日-4月20日） new</a>
					<span id="">
						2017-04-17 10:00:00
					</span>
				</div>
			</div>
			<div id="page">
				<a href="">1</a>
			</div>
		</div>
		<script src="/bck/static/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(document).ready(function(){
			        var this_page=1;  //表示当前页
				    $('#page').on('click','a',function(e){//点击那一页跳转那一页的内容
				        e.preventDefault();//阻止a标签的跳转行为
				        var val=$(this).attr('page');//取当前的页码
				        this_page=val;//同步修改当前页码
				        $.ajax({
				            type:"get",
				            url:"/ajax.php?ajax=wenz",
				            data:{
				                page:val
				            },
				            dataType:'json',
				            success:function(mgs){
				            	//console.log(mgs);
				                var data=mgs.data;
				                var count=mgs.count;
				                var html='';
				                for (var i in data) {
				                    html+="<div class='div1_1_1'>";
				                    for (var d in data[i]) {
				                        if(d=='uid'||d=='name_id'||d=='time'||d=='img'||d=='recommend'||d=='name_id'||d=='content')
				                        {
				                            continue;
				                        }
				                        html+="<a class='auid' uid='"+data[i]['uid']+"' href='javascript:;'>"+data[i][d]+"</a><span id=''>12017-04-17 10:00:00</span>";
				                    }
				                    html+='</div>';
				                }
				                $('#div1_1').html(html);
				                $(".auid").click(function(){
				                	
				                	$.ajax({
				                		type:"post",
				                		//url:"/ajax.php?ajax=a",
				                		url:"/a.php",
				                		//dataType:'json',
				                		data:{
				                			uid:$(this).attr("uid")
				                		},
				                		success:function(mgs1){
				                			console.log(mgs1);
				                			window.location.href="/b.html";
				                		}
				                	});
				                	
				                });
				                
				                
				                var Ahtml='';
				                for (var i=1;i<=count;i++) {
				                    if(this_page==i)
				                    {
				                        Ahtml+="<a class='a' style='color:black' page='"+i+"'>"+i+"</a> "
				                    }else{
				                        Ahtml+="<a class='a' page='"+i+"'>"+i+"</a> ";
				                    }
				                }
				                $('#page').html(Ahtml);
				            }
				        });
				    });
				    $('#page>a').trigger('click');//trigger(必需。规定指定元素上要触发的事件) 方法触发被选元素上指定的事件。
			   }); 
		</script>
	</body>
</html>
